import _ from "lodash";
import {FC, useState} from "react";
import {Tabs} from "antd-mobile";
import {Platform} from "@/config";
const Tab = Tabs.Tab;

interface PlatformTabsProps {
    className?: string;
}

const PlatformTabs: FC<PlatformTabsProps> = ({className = ""}) => {
    const [activeKey, setActiveKey] = useState(_.first(Platform)?.value);
    return (
        <Tabs className={className} activeKey={activeKey} onChange={setActiveKey}>
            {_.map(Platform, ({name, value}) => (
                <Tab title={name} key={value} />
            ))}
        </Tabs>
    );
};

export default PlatformTabs;
